﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebWise.Models;

namespace WebWise.Controllers
{
    public class HowToController : Controller
    {
        //
        // GET: /HowTo/
        private HowToModel howTo;
        private int articleNumber;

        public ActionResult helpIndex(string articleNum)
        {
            articleNumber = Convert.ToInt32(articleNum);
            return View("helpIndex", SuperController.GetGlobalModel());            
        }

        public ActionResult helpContents()
        {
            return View("helpContents", SuperController.GetGlobalModel());
        }

        public ActionResult helpSearch()
        {
            return View("helpSearch", SuperController.GetGlobalModel());
        }

        public ActionResult helpArticle(string articleNum)
        {
            articleNumber = Convert.ToInt32(articleNum);
            howTo = new HowToModel(articleNumber);
            //howTo.home = SuperController.GetGlobalModel();

            if (howTo.numValid)
            {
                return View("helpArticle", howTo);
            }
            else
            {
                return View("helpError", SuperController.GetGlobalModel());
            }
        }

    }
}
